package com.cyx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;
import java.util.Date;

@Controller
public class IndexController {
    @GetMapping("/index")
    public String index(Model model){
        model.addAttribute("name","thymeleaf");
        model.addAttribute("time", new Date());
        model.addAttribute("sample","sample:<p th:text=\"{$msg}\">只看到我说明没有被转义</p>");
        model.addAttribute("books", Arrays.asList("python","java","delphi"));
        return "index";
    }
}
